<template>
    <n-carousel trigger="hover" draggable autoplay>
        <a v-for="(rs,index) in list" :key="index" @click="navTo(rs.url)"  href="javascript:void(0)">
            <img class="carousel-img" :src="rs.pic">
        </a>
    </n-carousel>
</template>


<script setup>
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue';
import { useRouter } from 'vue-router';
const router = useRouter();
const {list} = defineProps(['list']);

const navTo = (url) => {
    if (!url) return;
    router.push(url);
}

</script>

<style scoped>
.carousel-img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
}
</style>